﻿@model FreeDAM.Domain.Entities.Asset

@{
    ViewBag.Title = "Details";
    FreeDAM.Domain.Entities.Rendition thumbnailImage;
    thumbnailImage = Model.Renditions.SingleOrDefault(r => r.FileName.Contains("_thumbnail"));
}

<h2>Details</h2>

<fieldset>
    <legend>Asset</legend>

    <div>
        <img src="@((thumbnailImage == null) ? Url.Content("~/media/thumbnailRendering.jpg") : Url.Content(thumbnailImage.ServerRelativePath))" alt="@Model.Name" />
    </div>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.Name)
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Name)
    </div>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.FileName)
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.FileName)
    </div>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.Published)
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Published)
    </div>

    @Html.DisplayFor(model => model.RenditionGroup.Name)
</fieldset>
<p>
    @Html.ActionLink("Edit", "Edit", new { id=Model.Id }) |
    @Html.ActionLink("Back to List", "Index") |
    @Html.ActionLink("Regenerate Renditions", "RegenerateRenditions", new { id=Model.Id })
</p>
